<template>
  <div id="app">
    <img alt="Vue logo" src="./assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js App"/>
    <h1 v-text="msg" ref="msgT"></h1>

    <button @click="showDom">点我输出上面的dom元素</button>
    <School  ref="sch"/>
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'
import School from "./components/School.vue";
export default {
  name: 'App',
  data() {
    return {
      msg: 'Hello World'
    }
  },
  components: {
    HelloWorld,School
  },

  methods: {
    showDom() {
      console.log(this.$refs.msgT) //获取真实DOM元素

      console.log(this.$refs.sch) //School组件的实例对象（vc）
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
